<style>
	table.data-table tbody tr td{text-align:center;}
</style>

<div class="row">
<?if(isset($system_message))echo $system_message;?>
<div class="alert-box secondary">
	Payment Records.
</div>

<?if(!empty($payments_made)):?>
	<div>
		<table class="table">
			<tr>
				<th colspan="6"><span class="label label-inverse">Payments Made</span></th>
			</tr>
			<tr>
				<th>Receipt Number</th>
				<th>Amount Paid</th>
				<th>Date Of Payment</th>
				<th>Mode Of Payment</th>
				<th>Remarks</th>
				<th>&nbsp;</th>
			</tr>
			<?foreach($payments_made as $pm):?>
			<tbody>
			<tr>
				<td><?=$pm->spr_or_no;?></td>
				<td>&#8369; <?=money($pm->spr_ammt_paid);?></td>
				<td><?=$pm->spr_payment_date;?></td>
				<td><?=$pm->spr_mode_of_payment;?></td>
				<td><?=$pm->spr_remarks;?></td>
				<td>
					<div class="btn-group">
					<a href="<?=site_url('guardian/show_payment_breakdown/'.$current_id.'/'.$enrollment_id.'/'.$pm->spr_id)?>" class="btn btn-mini">Show Payment</a>
					</div>
				</td>
			</tr>
			<?endforeach;?>
		</tbody>
		</table>
	</div>
	<?else:?>
		<div class="alert">No Payments Made <a href="<?=site_url('guardian/');?>" class="data-link">Go Back</a></div>
	<?endif;?>
	
	<?if(!empty($payment_breakdown)):?>
		<div>
			<span class="label label-info">Breakdown Of Payments with O.R Number <?=$payment_breakdown[0]->spr_or_no?></span>
			<br>
			<table class="table">
					<tr>
						<th>Name Of Fee</th>
						<!--<th>Rate</th>-->
						<th>Paid</th>
						<!--<th>Remaining Balance</th>-->
						<th>Fee Type</th>
					</tr>
					<?foreach($payment_breakdown as $pb):?>
						<tr>
							<td><?=$pb->spb_fee_name;?></td>
							<!--<td><?//=money($pb->spb_fee_rate);?></td>-->
							<td><?=money($pb->spb_amount_paid);?></td>
							<!--<td><?//=money($pb->spb_remaining_balance);?></td>-->
							<td>
								<?
									if($pb->spb_is_tuition_fee == 1){
										echo 'Tuition';
									}elseif($pb->spb_is_misc_fee == 1){
										echo 'Miscellaneous';
									}elseif($pb->spb_is_other_fee == 1){
										echo 'Others';
									}elseif($pb->spb_is_elective_fee == 1){
										echo 'Electives';
									}elseif($pb->spb_is_cca_fee == 1){
										echo 'CCA';
									}
								?>
							</td>
						</tr>
					<?endforeach;?>
			</table>
		</div>
<?endif;?>
</div>

<a href="<?=site_url('fees/view_fees/'.$enrollment_id);?>" class="btn btn-primary">Go Back</a>
